import java.lang.Thread;

public class Test3 {
    public static void main(String[] args) {
        Print1 p1 = new Print1();

        p1.start();

        Print2 p2 = new Print2();

        new Thread(p2).start();

    }
}

class Print1 extends Thread {
    public void run() {
        for (int i = 1; i <= 1000; i++) {
            if (i % 3 == 0) {
                System.out.println(Thread.currentThread().getName() + ": " + i);
            }
        }
    }
}

class Print2 implements Runnable {
    public void run() {
        for (int i = 1000; i <= 2000; i++) {
            if (i % 5 == 0) {
                System.out.println(Thread.currentThread().getName() + ": " + i);
            }
        }
    }
}